﻿<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="content-type" content="text/html" />
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="description" content="Free Web tutorials"/>
    <meta name="keywords" content="HTML,CSS,XML,JavaScript"/>
	<link rel="stylesheet" href="http://meyerweb.com/eric/tools/css/reset/reset.css" type="text/css">
	<title>admin</title>
	<style>
		body{ width:960px; height:auto; margin:0 auto; }
		form{ width:960px; height: 90px; margin:10px 0; padding: 15px 0; text-align:center; background: #ccc; }
		h3{ font-weight: bold; font-size: 17px; margin: 15px 0; }
		table{ padding: 0; margin: 0; width:960px; }
		thead{ padding: 0; margin: 0; background: #ccc; font-weight: bold; }
		td{ margin: 0; padding: 5px 15px; border-bottom: 1px solid #000;}
		ul li{ margin: 10px 0; }
		ul.vertical	li{ float:left; padding:0 10px; margin: 0; }	
		.vertical a{ text-decoration:none; }
	</style>
</head>
<body>
<?php
// login 
if($action == 'login') {
?>
<form action="<?php echo base_url()?>scic_admin/" method="post">
	<h3>ADMIN LOGIN</h3>
	<label>Key:</label>
	<input type="password" name="key" />
	<input type="submit" value="submit" name="submit" />
</form>
<?php 
}
else {
	// load navigation	
?>
	<ul>
		<li><a href="<?php echo base_url()?>scic_admin/?action=1">Thống kê quà thưởng</a></li>
		<li><a href="<?php echo base_url()?>scic_admin/?action=2">Danh sách người chơi trúng thưởng (theo tuần)</a></li>
		<li><a href="<?php echo base_url()?>scic_admin/?action=3">Danh sách mã dự thưởng Fonepad</a></li>
		<li><a href="<?php echo base_url()?>scic_admin/?action=4">Thoát</a></li>
	</ul>
	<hr>
<?php
	// list thong ke
	if($action == 'list_thong_ke') { 
?>
	<!--thong ke-->
	<h3>Thống kê quà thưởng</h3>
	<table>
		<thead>
			<tr>
				<td>Tuần</td>
				<td>Quà thưởng ( Áo )</td>
				<td>Quà thưởng ( Sổ )</td>
				<td>Quà thưởng ( Quà may mắn )</td>
			</tr>	
		</thead>
		<tbody>
		<?php
		for($i=1; $i<=3; $i++) {
		?>
			<tr>
				<td><?php echo $i; ?></td>
				<td><?php echo 50-$week[$i]['data']['ao'].'/50'; ?></td>
				<td><?php echo 50-$week[$i]['data']['so'].'/50'; ?></td>
				<td><?php echo 2-$week[$i]['data']['wish'].'/2'; ?></td>
			</tr>
		<?php 
		}
		?>
		<tbody>
	</table>	
<?php		
	}
	// list trung thuong
	else if($action == 'list_trung_thuong') {
?>
	<!--ds trung thuong tuan-->
	<h3>Danh sách người chơi trúng thưởng (theo tuần)</h3>
	<p style="float:left; margin-bottom: 15px;">Loại quà: </p>
	<ul class="vertical">
		<li><a href="<?php echo base_url()?>scic_admin/?action=2&search=ao">* Áo thun</a></li>
		<li><a href="<?php echo base_url()?>scic_admin/?action=2&search=so">* Sổ</a></li>
		<li><a href="<?php echo base_url()?>scic_admin/?action=2&search=wish">* Mã may mắn</a></li>
	</ul>
	<table>
		<thead>
			<tr>
				<td>Tuần</td>
				<td>Thời gian</td>
				<td>Quà thưởng</td>
				<td>Họ tên</td>
				<td>Địa chỉ</td>
				<td>CMND</td>
				<td>Điện thoại</td>
				<td>Email</td>
			</tr>	
		</thead>
		<tbody>		
			<tr>
				<td>1</td>
				<td>18/12/2014</td>
				<td>Áo thun</td>
				<td>Nguyễn Văn A</td>
				<td>Q5 TPHCM</td>
				<td>0123456789</td>
				<td>0121121451</td>
				<td>ngvana@mail.com</td>
			</tr>
		<tbody>
	</table>
<?php	
	}	
	// list fonepad code
	else if($action == 'list_du_thuong') {
?>
	<!--ds du thuong fonepad-->
	<h3>Danh sách mã dự thưởng Fonepad (Tổng <span style="color:red">1200</span> mã dự thưởng)</h3>
	<table>
		<thead>
			<tr>
				<td>Tuần</td>
				<td>Thời gian</td>
				<td>Quà thưởng</td>
				<td>Họ tên</td>
				<td>Địa chỉ</td>
				<td>CMND</td>
				<td>Điện thoại</td>
				<td>Email</td>
			</tr>	
		</thead>
		<tbody>
			<tr>
				<td>1</td>
				<td>18/12/2014</td>
				<td>Áo thun</td>
				<td>Nguyễn Văn A</td>
				<td>Q5 TPHCM</td>
				<td>0123456789</td>
				<td>0121121451</td>
				<td>ngvana@mail.com</td>
			</tr>
		<tbody>
	</table>
<?php
	}
} 
?>
</body>
</html>